#ifndef _DL485_FL_H
#define _DL485_FL_H

/* #include "../common/common_modbus.h"
#include "../../bsp/base_type.h"
#include "../common/device_manager.h"

extern xp_bool dl485_voice_play(struct xp_modbus_device *dev, int item);
extern xp_bool dl485_voice_init(); */

#include "../../../1km/bsp/bsp.h"

#define ADDR_TEST               0x0000             //测试
#define ADDR_PLAY_MODE          0x0001             //工作模式
#define ADDR_PLAY_VOLUME        0x0002             //模块音量
#define ADDR_EQ_MODE            0x0003             //EQ模式
#define ADDR_VOICE_PLAY         0x0004             //语音播放
#define ADDR_VOICE_UP           0x0005             //音量增加
#define ADDR_VOICE_DOWN         0x0006             //音量减小
#define ADDR_PAUSE_PLAY         0x0009             //暂停
#define ADDR_CLEAR_PLAY         0x000A             //停止播放，情况列表

typedef struct{
	uint8_t 	slave_id;    		    //modbus slave id
	uint8_t 	port;    			    //modbus uart port
    uint32_t 	speed;   			    //modbus uart speed
    uint8_t 	rec_data[60];    	    //modbus recive buffer
    uint8_t 	rec_len; 			    //modbus recive data length
}Type_Com_Def;

typedef struct
{
	uint16_t		version;
    uint32_t        logTime;
    bool            isInitOk;
	Type_Com_Def 	com;
	// Type_Param_Def 	param;
}Type_dl485_Def;

extern int dl485_voice_init(void);
extern int dl485_voice_play(uint8_t id, int item);
extern int dl485_voice_set_volume(uint8_t id, uint8_t volume);

#endif

